package com.moss.common.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.moss.common.domain.BaseEntity;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.web.bind.annotation.GetMapping;

import javax.validation.constraints.NotNull;
import java.time.LocalDateTime;
import java.util.List;

@Data
public class SysSampleEntity extends BaseEntity {

    /** 采样id*/
    private String sampleId;

    /** 采样编号*/
    @NotNull(message = "采样编号不能为空")
    private String sampleNo;

    @NotNull(message = "受检企业不能为空")
    private String companyId;

    /** 受检企业*/
    @NotNull(message = "受检企业不能为空")
    private String companyName;

    /** 受检企业信用代码*/
    @NotNull(message = "受检企业信用代码不能为空")
    private String uniformCode;

    @NotNull(message = "采样人不能为空")
    private Long samplerId;

    /** 采样人*/
    @NotNull(message = "采样人不能为空")
    private String sampler;

    /** 采样人签名*/
    @NotNull(message = "采样人签名不能为空")
    private String samplerSign;

    /** 采样商品id*/
    @NotNull(message = "采样商品不能为空")
    private Long goodsId;

    /** 采样商品*/
    @NotNull(message = "采样商品不能为空")
    private String goodsName;

    /** 检测项目id 多个用，隔开*/
    private String itemId;
    /** 提交时存放 itemIds*/
    private String[] itemIds;

    /** 检测项目集合，多个用，隔开*/
    private String itemName;

    /** 采样类型，task-任务检测，deliver-商户送检，self-企业自检*/
    @NotNull(message = "采样类型不能为空")
    private String sampleType;

    @NotNull(message = "采样机构不能为空")
    private Long sampleOrgId;

    /** 采样机构编码-信用代码*/
    @NotNull(message = "采样机构信用代码不能为空")
    private String sampleOrgCode;

    /** 采样机构*/
    @NotNull(message = "采样机构不能为空")
    private String sampleOrgName;

    /** 采样时间*/
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    @NotNull(message = "采样时间不能为空")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime sampleTime;

    /** 是否检测，1是0否*/
    private Integer status;

    /** 地址*/
    private String address;

    /** 备注*/
    private String remark;

    /** 采样项目合集*/
    private List<SysSampleItemEntity> itemList;

    /** 现场送检数据*/
    private SysSampleDeliverEntity deliver;

    private SysSampleTaskEntity task;
}
